package com.wantong.jianpu.adapters;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.BaseLoadMoreModule;
import com.chad.library.adapter.base.module.LoadMoreModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.wantong.jianpu.R;
import com.wantong.jianpu.beans.InspectionDetailBean;

/**
 * @author PACY
 * @date 2022/4/25
 * description:
 */
public class ConfirmListAdapter extends BaseQuickAdapter<InspectionDetailBean.RecordListDTO, BaseViewHolder> implements LoadMoreModule {
    public ConfirmListAdapter() {
        super(R.layout.confirm_list_item_view);
    }

    @Override
    protected void convert(BaseViewHolder holder, InspectionDetailBean.RecordListDTO s) {
        holder.setText(R.id.time_tv,s.getCreateTime())
                .setText(R.id.area_tv,s.getLocationName());
        if(s.getIfSign()==0){
            holder.setText(R.id.sign_tv,"待签字确认").setTextColorRes(R.id.sign_tv,R.color.errorColor);
        }else{
            holder.setText(R.id.sign_tv,"已签字确认").setTextColorRes(R.id.sign_tv,R.color.colorPrimary);
        }
    }

    @Override
    public BaseLoadMoreModule addLoadMoreModule(BaseQuickAdapter<?, ?> baseQuickAdapter) {
        return new BaseLoadMoreModule(baseQuickAdapter);
    }
}
